// app.js
//直接导入js模块不带名字=>执行这个js
import "./utils/index"
import "./utils/request"
App({
  onLaunch() {
    this.getToken()
  },
  globalData: {},
  //全局数据和方法
  token: '',
  getToken() {
    wx.getStorage({
      key: 'share-token',
      success: (res) => {
        this.token = res.token
      },
    });

  },
  setToken(token) {
    //全局变量存token
    this.token = `Bearer ${token}`
    //本地持久化
    wx.setStorageSync('share-token', this.token);

  }
})
